#pragma once
#include "station.h"

class Harbor :
	public Station
{
private:
	int Deadline()	{	return absoluteTime + SHIP_OUTOF_DELAY ;}
	int finalLeaveTime ;
	int IntoAvailTime() { return finalLeaveTime + SHIP_INTO_DELAY; }
	int intoDelaySum;
	void addIntoDelay(int val) { intoDelaySum += val; }
	int outofDelaySum;
	void addOutofDelay(int val) { outofDelaySum += val; }
	int timeoutNum;
	void increaseTimeoutNum()	{timeoutNum++;}
	bool isEnoughLoad(Transport* transport) { 	return 2 * transport->CurrentLoad() > transport->Capacity() ; }


public:
	void pushEvent(Transport* transport , STATE state);

	void EnterStation(Transport* transport) ;
	void UnloadAndLoad(Transport* transport) ;
	void Leave(Transport* transport) ;
	bool isAdditionalLoad() {return true;}
	void AdditionalLoad(Transport* transport);

	void printResult(ostream &out);

	Harbor(void);
	virtual ~Harbor(void);
};
